'use strict';

module.exports = app => {
  const { STRING, UUID, UUIDV4 } = app.Sequelize;

  const model = app.model.define('role_power', {
    id: {
      type: UUID,
      primaryKey: true,
      defaultValue: UUIDV4,
      comment: '主键',
    },
    role_id: {
      type: UUID,
      comment: '角色id',
    },
    power_code: {
      type: STRING,
      comment: '权限代码',
    },
    power_text: {
      type: STRING,
      comment: '权限名称',
    },
  }, {
    tableName: 'role_power',
    comment: '角色权限表',
  });

  return model;
};
